package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzQueryParam;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper//作用是将接口交给spring容器管理
public interface ClazzMapper {

    //添加班级
    @Insert("insert into clazz (name, room, begin_date,end_date,master_Id,subject,create_time,update_time) " +
            "values (#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    void insert(Clazz clazz);

    //查询所有班级
    @Select("select * from clazz")
    List<Clazz> list();

    //班级列表查询使用分页插件pageHelper
    List<Clazz> Page(ClazzQueryParam clazzQueryParam);

    //根据id删除班级
    @Delete("delete from clazz where id =#{id}")
    void delete(Long id);


    //1.根据id查询班级 查询回显
    Clazz get(Long id);

    //2.查询回显后修改班级
    void update(Clazz clazz);
}
